﻿using Abp.Application.Services.Dto;
using System;

namespace ARchGL.Platform.Dtos
{
    /// <summary>
    /// 文件夹信息 ViewModel
    /// </summary>
    public class FolderDto : EntityDto<Guid>
    {
        /// <summary>
        /// 主键标识（项目/人员等等）
        /// </summary>
        public Guid? PrimaryId { get; set; }
        /// <summary>
        /// 《检验批》验收节点标识
        /// </summary>
        public Guid PrimaryId1 { get; set; }
        ///// <summary>
        ///// 场景标识
        ///// </summary>
        //public Guid PrimaryId2 { get; set; }
        /// <summary>
        /// 上级分类
        /// </summary>
        public Guid? ParentId { get; set; }
        /// <summary>
        /// 文件/文件夹 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 大小（存储单位为 B）
        /// </summary>
        public int Size { get; set; }
        /// <summary>
        /// 创建人标识
        /// </summary>
        public Guid? CreatorUserId { get; set; }
        /// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatorUserName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 创建时间戳
        /// </summary>
        public long CreationUniversalTime { get { return CreationTime.ToUnixTimestamp(); } }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? LastModificationTime { get; set; }
        /// <summary>
        /// 更新时间时间戳
        /// </summary>
        public long LastModificationUniversalTime
        {
            get
            {
                return LastModificationTime.HasValue
                    ? LastModificationTime.Value.ToUnixTimestamp()
                    : DateTime.MinValue.ToUnixTimestamp();
            }
        }

        /// <summary>
        /// 类型
        /// </summary>
        public EnumDocumentPType PType { get; set; }

        /// <summary>
        /// 是否同步
        /// </summary>
        public bool State { get; set; }

        /// <summary>
        /// 是否系统级
        /// </summary>
        public bool IsSystem { get; set; }
        /// <summary>
        /// 透传字段
        /// </summary>
        public string TransInfo { get; set; }
    }

    /// <summary>
    /// 检验批相关
    /// </summary>
    public class FolderDtoForCheckP : FolderDto
    {
        /// <summary>
        /// 绑定的构件标识
        /// </summary>
        public string[] PropertyIds { get; set; }

        /// <summary>
        /// 模板标识
        /// </summary>
        public Guid TemplateId { get; set; }
    }
}
